<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>注册审核</title>
    <jsp:include page="../../head.jsp"/>
</head>
<script type="text/javascript">
    var formSetting = {
        title: "注册审核",
        module: 'query',
        numCount: '2',
        columns: [{
            index: "COM_NAME",
            name: "com_name",
            label: "公司名称"
        }, {
            index: "APPROVE_STATUS",
            name: "approve_status",
            type: "dropdown",
            data: [["通过", "0"], ["不通过", "1"]],
            label: "审核结果"
        }, {
            index: "REG_TIME",
            name: "reg_time",
            type: "date",
            label: "注册时间起",
            op: "ge"
        }, {
            index: "REG_TIME",
            name: "reg_time",
            label: "注册时间止",
            type: "date",
            op: "le"
        }],
        buttons: {
            custom: [{
                id: "approvebtn",
                value: "审核",
                click: function () {
                    var id = $("#approveRegDataGrid").jqGrid("getGridParam",
                                                             "selrow");
                    if (id) {
                        var reg_company_id = $("#approveRegDataGrid").jqGrid('getRowData',
                                                                             id).reg_company_id;
                        window.location.href =
                                "approve-platformApprove?reg_company_id="
                                + reg_company_id;
                    } else {
                        jw.alert("请点击需要操作的数据!");
                    }
                }
            }]
        },
        grid: {
            id: "approveRegDataGrid",
            title: "查询结果",
            url: "approve-findList",
            colModel: [{
                index: "reg_company_id",
                name: "reg_company_id",
                label: "REG_COMPANY_ID",
                hidden: true
            }, {
                index: "com_name",
                name: "com_name",
                label: "公司名称"
            }, {
                index: "com_code",
                name: "com_code",
                label: "统一社会信用代码"
            }, {
                index: "com_customs_code",
                name: "com_customs_code",
                label: "海关企业注册代码"
            }, {
                index: "com_link_person",
                name: "com_link_person",
                label: "公司联系人"
            }, {
                index: "com_link_phone",
                name: "com_link_phone",
                label: "联系人电话"
            }, {
                index: "com_email",
                name: "com_email",
                label: "公司邮箱"
            }, {
                index: "customs_broker",
                name: "customs_broker",
                label: "推荐报关行"
            }, {
                index: "customs_broker_id",
                name: "customs_broker_id",
                hidden: true,
                label: "推荐报关行"
            }, {
                index: "approve_status",
                name: "approve_status",
                label: "报关行审核状态"
            }, {
                index: "platform_approve_status",
                name: "platform_approve_status",
                label: "平台审核状态"
            }, {
                index: "reg_time",
                name: "reg_time",
                formatter: 'date',
                formatoptions: {srcformat: 'Y-m-d H:i:s', newformat: 'Y-m-d H:i:s'},
                label: "注册时间"
            }],
            sortname: "reg_time",
            sortorder: "desc",
            jsonReader: {
//                root: "registeredCompanyDtos"
            },
            loadComplete: function (data) {
                $("td[aria-describedby='approveRegDataGrid_approve_status']").each(function () {
                    if ($(this).text() == "0") {
                        $(this).text("通过");
                    } else if ($(this).text() == "1") {
                        $(this).text("不通过");
                    }
                });
                $("td[aria-describedby='approveRegDataGrid_platform_approve_status']").each(
                        function () {
                            if ($(this).text() == "0") {
                                $(this).text("通过");
                            } else if ($(this).text() == "1") {
                                $(this).text("不通过");
                            }
                        });
            }
        }
    };
    $(document).ready(function () {
        $("#approveRegDataTable").mrdForm(formSetting);
    });
</script>
<body>
<div id="approveRegDataTable"></div>
</body>
</html>
